In recent years, a technique for detecting a main object, such as a person, from an image and making such gradation correction that a brightness of the object is made proper has been proposed. In this instance, it is a subject to prevent a viewer from feeling that a saturation decrease has occurred after the gradation correction. This point will be described by using FIGS. 22 and 23.
FIG. 22 is an example of a pixel value included in a dark area in the image. The abscissa axis indicates each component of RGB and the ordinate axis indicates component values. Since the pixel is a pixel in the dark area, the RGB component values are small values as a whole.
As for such a pixel value, the RGB component values are converted into a luminance-color-difference space (for example, YCbCr space), only a luminance component is increased by a predetermined amount in such a space and converted into the RGB space again, and an obtained result is illustrated in FIG. 23.
As illustrated in FIG. 23, if only a luminance value in the luminance component is increased by a predetermined amount, a predetermined amount 2301 is uniformly added to all components in the RGB space.
As is well known, a state where the saturation of the pixel value is large is a state where relative differences among the RGB components are large. If the relative ratio among the RGB components is equal to 1.0, that is, if they have the same value, such a pixel is regarded as a gray pixel having a saturation of 0. For example, in FIG. 22, although the relative ratio of the G component to the R component is equal to about 2.0 times, such a ratio after the increase in luminance is equal to about 1.3 times and it can be confirmed that the saturation was reduced.
If only the luminance in the pixel value included in the dark area in the image is increased in the luminance-color-difference space as mentioned above, an unattractive image is obtained in which the saturation is reduced.
To solve the above problem, a method of controlling the saturation so as to keep a relative distance to a color-space boundary in the luminance-color-difference space has been proposed in the Official Gazette of Japanese Patent Application Laid-Open No. 2001-45311. The Official Gazette of Japanese Patent Application Laid-Open No. 2002-271644 has also been known as a similar example. In the Official Gazette of Japanese Patent Application Laid-Open No. 2002-271644, various kinds of color-space-boundary examples are presented and a method of relatively maintaining the saturation in a range before and after the luminance increasing process by executing processes which are almost similar to those in the Official Gazette of Japanese Patent Application Laid-Open No. 2001-45311 is disclosed.
However, the above-described art have the following problems.
First, if the method of keeping the relative distance to the color-space boundary as disclosed in the related art is uniformly applied with respect to all hues and saturations, there is a case where a correction result indicates overcorrection. For example, the reproducibility of a skin-color area is an element that becomes very important in an output of a digital camera or a printer. It has been confirmed by experiments that if the above system is applied to the skin-color area, the saturation is excessively emphasized and a human skin and face become reddish, so that an undesirable result is obtained.
Problems that occur when applying the Official Gazette of Japanese Patent Application Laid-Open No. 2001-45311 will be described by using FIG. 24. In the diagram, the ordinate axis indicates the luminance and the abscissa axis indicates the saturation at a certain hue. Reference numerals 2405 and 2404 denote a saturation value and a luminance value of a target-pixel value before and after the luminance correction, respectively. Reference numeral 2401 denotes a boundary of an arbitrary color space (for example, sRGB space). That is, it is assumed that the sRGB color space can exist only in a closed area surrounded by the boundary 2401 and a Y axis. In this case, when relative distances 2403 and 2402 from the color-space boundary 2401 before and after the increase in luminance of the target pixel are equal as illustrated in the diagram, even if the luminance is increased, the saturation is not emphasized and an unattractive image that provides the viewer with a feeling that the saturation has decreased is also obtained.
Further, a case will now be considered in which the luminance of a target pixel 2503 before the correction is larger than the luminance value of a maximum saturation point 2502 at the hue of the target pixel, as illustrated in FIG. 25. In this case, if it is intended to maintain the relative relation with a color-space boundary 2501, the saturation of a pixel 2504 after the correction decreases as compared with that before the correction as illustrated in the diagram. In this case, an unattractive image that provides the viewer with the feeling that a saturation decrease has occurred is also obtained.
The invention is made in consideration of the foregoing problems and intends to present image processing apparatus and method in which, by making proper saturation control, even after a gradation correction was made, a good-looking, desirable image, better than that in the related art, can be provided, while preventing overcorrection and preventing the viewer from feeling that a saturation decrease has occurred.